/*
 * Copyright (c) 2017年11月10日  by XuanWu Wireless Technology Co., Ltd 
 *             All rights reserved  
 */
package com.zml.twelfth.example;

import com.zml.twelfth.example.duck.Quackable;
import com.zml.twelfth.example.observable.Observer;

/**
 * @author <a href="mailto:zhaominglin@wxchina.com">minglin.Zhao</a>
 * @Description 装饰者
 * @Date 2017/11/10
 * @Version 1.0.0
 */
public class QuackCounter implements Quackable {
    Quackable duck;
    static int numberOfDuacks;

    public QuackCounter(Quackable duck) {
        this.duck = duck;
    }

    @Override
    public void quack() {
        duck.quack();
        numberOfDuacks++;
    }

    public static int getNumberOfDuacks() {
        return numberOfDuacks;
    }

    @Override
    public void registerObserver(Observer observer) {

    }

    @Override
    public void notifyObservers() {

    }
}
